package com.example;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import com.example.pojo.MyProperties2;

@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
// 要使用构造函数绑定，必须通过 @EnableConfigurationProperties 或配置属性扫描来启用该类。
@EnableConfigurationProperties({MyProperties2.class})
public class MyApplication {

    public static void main(String[] args) {

        SpringApplication application = new SpringApplication(MyApplication.class);
//        application.setAddCommandLineProperties(false);
        application.run(args);

        /*
        // 2.2.2
        // 创建Spring应用实例
        SpringApplication application = new SpringApplication(MyApplication.class);
        // 禁用启动横幅
        application.setBannerMode(Banner.Mode.OFF);
        // 设置非Web应用程序类型
        application.setWebApplicationType(WebApplicationType.NONE);
        // 运行应用
        application.run(args);*/
    }

}

